import React from "react";
import { ConfigProvider, Calendar } from "react-vant";
import locale from "../utils/date";
type Props = {
  setShowCloseIcon: any;
};

const Calendars = (props: Props) => {
  return (
    <div className="demo-config-prodiver">
      <ConfigProvider locale={locale}>
        <Calendar
          style={{ height: 400 }}
          poppable={false}
          onConfirm={(v: any) => {
            const mou = v.getMonth() + 1;
            const day = v.getDate();
            const time = `${mou}月${day}日`;
            localStorage.setItem("date", time);
            props.setShowCloseIcon(false);
          }}
        />
      </ConfigProvider>
    </div>
  );
};

export default Calendars;
